FROM hub.c.163.com/library/ubuntu:16.04
MAINTAINER junhui

RUN apt-get update -y && apt-get install -y software-properties-common && apt-get install -y wget

RUN wget http://mirrors.tuna.tsinghua.edu.cn/apache/spark/spark-2.2.1/spark-2.2.1-bin-hadoop2.7.tgz
# java下载地址可能失效，请替换成自己的
RUN wget http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.tar.gz


RUN tar -zxvf spark-2.2.1-bin-hadoop2.7.tgz -C /usr/local/spark
RUN tar -zxvf jdk-8u161-linux-x64.tar.gz -C /usr/local/jdk1.8.0_161

# 配置环境
ENV JAVA_HOME /usr/local/jdk1.8.0_161
ENV CLASSPATH $JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV PATH $PATH:$JAVA_HOME/bin:$CATALINA_HOME/lib:$CATALINA_HOME/bin

#容器运行时监听的端口  
EXPOSE  2181